# _*_ coding : utf-8 _*_
# @Time : 2022/8/13 10:58
# @Author : Moonquake
# @File : 25.selenium_元素信息
# @Project : python
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.edge.service import Service

url = 'https://www.baidu.com'

path = Service('MicrosoftWebDriver.exe')

browser = webdriver.Edge(service=path)

browser.get(url)

input = browser.find_element(By.ID,"su")
# 获取元素信息
print(input.get_attribute('class'))
# 获取标签名
print(input.tag_name)
# 获取文本内容
a= browser.find_element(By.LINK_TEXT,"新闻")
print(a.text)
